/**
 * Created by rongyao on 2017/11/13.
 */
import React from 'react'
import ReactDOM from 'react-dom'
import {Router,Route,hashHistory,IndexRoute} from 'react-router'
import {Provider} from 'react-redux'
import store from './store/index'

import App from './components/app.js'
import HomeContext from './components/home/home.js'
import NewsContext from './components/news/news.js'
import newsDetailContext from './components/newsDetail/newsDetail.js'
import productContext from './components/product/product.js'
import ProductDetailContext from './components/productDetail/productDetial.js'
import ShopCarContext from './components/shopCar/shopCar.js'



ReactDOM.render(
	<Provider store={store}>
		<Router history={hashHistory}>
			<Route path="/" component={App}>
				<IndexRoute component={HomeContext}/>
				<Route path="news" component={NewsContext}/>
				<Route path="newsDetail/:index" component={newsDetailContext}/>
				<Route path="product" component={productContext}/>
				<Route path="productDetail/:index" component={ProductDetailContext}/>
				<Route path="shopCar" component={ShopCarContext}/>
			</Route>
		</Router>
	</Provider>,document.getElementById('app'))